package com.mr.web.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mr.model.Member;

@Controller
public class MemberController extends AnnotationController{
	@RequestMapping("/auth/member/company/memberList.xhtml")
	public String memberList(ModelMap model) {
		String qry = "from Member m where m.membertype=? and m.id!=m.parentid order by m.id desc";
		List<Member> memberList = hibernateTemplate.find(qry, Member.MEMBERTYPE_COMPAMNY);
		model.put("memberList", memberList);
		return showJsonSuccess(model);
	}
	@RequestMapping("/auth/member/company/addMember.xhtml")
	public String addMember(Integer start, Integer limit, ModelMap model) {
		String qry = "from Member m where m.membertype=? and m.id!=m.parentid order by m.id desc";
		List<Member> memberList = hibernateTemplate.find(qry, Member.MEMBERTYPE_COMPAMNY);
		model.put("memberList", memberList);
		return showJsonSuccess(model);
	}
}
